package com.youi.service;

import com.youi.entity.User;
import com.youi.entity.Userwechat;

public interface UserwechatService extends BaseService<Userwechat>{

	/**
	 * 根据unionid查询已关联的用户id
	 * @param unionid
	 * @return
	 */
	public User getWeChatLicenseUserId(String unionid);
	
	/**
	 * 查询数据库的用户微信数据
	 * @param appid
	 * @param openid
	 * @param unionid
	 * @param subscribe
	 * @return
	 */
	public Userwechat getUserwechat(String appid,String openid,String unionid,String subscribe,String ip);
	
	/**
	 * 获取新用户
	 * @param avatarUrl
	 * @param nickName
	 * @param gender
	 * @return
	 */
	public User getNewUser(String avatarUrl,String nickName,String gender,String phone);

	/**
	 * 更新同一个unionid的用户关联
	 * @param unionid
	 * @param userId
	 */
	public void updateAllUnion(String unionid,Long userId);
	
}